<template>
  <div class="dialog-box">
      <el-dialog class="dialog" title="查看详情" v-model="visible" top="80px" draggable :show-close="false"
          :before-close="handleCancel">
          <template #header="{ close, titleId, titleClass }">
              <div class="my-header">
                  <h4 :id="titleId" :class="titleClass">查看详情</h4>
                  <el-button class="close-btn" @click="handleCancel">
                      关闭
                  </el-button>
              </div>
          </template>
          <div class="print-dialog">
              <pre v-highlight>
                  <code>{{ printHtml }}</code>
              </pre>
          </div>
      </el-dialog>
  </div>

</template>

<script setup>
import Api from '@/api'
const router = useRouter()
const props = defineProps({
  visible: {
      type: Boolean,
      required: false,
  },
  printHtml:{
    required: false,
  }
})
const visible = toRef(props, 'visible')


// 取消
const emit = defineEmits(['emitCancel', 'emitSubmit',])
const handleCancel = () => {
  emit('emitCancel', 'cancel')
}
// 确认
const handleSubmit = () => {
  emit('emitSubmit', 'submit')
}

</script>

<style  lang="scss" scoped>
.dialog-box {
  ::v-deep {
      .el-dialog {

          width: 660px;
          height: 800px;
          background: #FFFFFF;
          border-radius: 16px;
      }
  }

  .btn-box {
      padding: 50px 50px 0;

      .btn {
          width: 200px;
          height: 80px;
          background: #FFE566;
          border-radius: 16px;
          font-family: Microsoft YaHei;
          font-weight: 400;
          font-size: 20px;
          color: #212121;
          margin: 0 0 20px 0;
          border: 0;
      }
  }
}

.color-FF3333 {
  color: #FF3333 !important;
}

.my-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 16px;

  .close-btn {
      width: 100px;
      height: 48px;
      background: #CCCCCC;
      border-radius: 8px;
  }
}
::v-deep .el-button:hover{
  color: #ff6a00 !important;
  // color: #fff !important;
  // border: 1px solid #ffe566;
  // background: #ffe566;
}
.print-dialog {
  height: 700px;
  overflow: auto;
}
</style>
